<?php
namespace Modules\ShopApi\Models;
use Modules\Admin\Models\Image as ImageModel;
class ShopConfig extends BaseApiModel
{	
	
	/**	 
	 * @name  获取关于我们信息	 
	 */
	public function config_content(){
		$content = $this->where(['id'=>1])->value('content');
		$content = replacePicUrl($content);
		return $this->api_success(['data'=>['content'=>$content]]);
	}
	/**	 
	 * @name  项目打赏	 
	 */
	public function reward(){
		$image_id = $this->where(['id'=>1])->value('image_id');
		$image_info = (new ImageModel())->find($image_id)->toArray();
		$http = getHttpType();
		if($image_info['open'] == 1){
			$image_url = $http . $image_info['url'];
		}else{
			$image_url = $image_info['url'];
		}
		return $this->api_success(['data'=>['image_url'=>$image_url]]);
	}
	/**	 
	 * @name  获取商城配置信息	 
	 */
	public function config_info(){ 
		$data = $this->where(['id'=>1])->select('wallet_pay_status','wechat_pay_status')->first()->toArray();
		return $this->api_success(['data'=>$data]);
	}
}
